-
Notifications
You must be signed in to change notification settings - Fork 117
Draggable Settings Control Example #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
TODO: Highlight gripper on hover and get Niels once over/opinion
Hmm, hitting the WebView2Loader issue trying to add the Behaviors dependency on WinUI... not sure why it works for our behaviors component, but not when I add it as a sample dependency to the Settings Samples shared project. @Sergio0694 I know you were planning to update Behaviors to 1.8 which may resolve this as well, eh? Error Details
Edit: I'm hitting this with our base behaviors package locally too, so it's not unique to this scenario for these samples. But it's working for Arlo. He's on an older VS version so he's updating to see if he can repro... weird. |
Just a thought. Might be better to bind Recording.2025-10-21.165719.mp4 |
@AndrewKeepCoding I didn't notice the toggles turning on/off they should maintain their state on drag 🤔. Some folks may use this capability for features that are enabled/disabled and ordered but may also have additional settings, so I don't think everyone will tie IsExpanded to the on toggle (though it's probably a good idea in general, so maybe it makes sense for the sample). For some reason on my machine I can't build the Behaviors component, so I still can't add the last bit I wanted to this sample. |
I've resolved my build issue! 🎉 Seemed like I maybe had a bad prototype/old version of the XAML Behaviors package in my NuGet cache. So I cleared my NuGet cache and hard cleaned my project/repo, and I seem to be back to a working state. 😅 |
…e of draggable bar with Behavior Addressed feedback from @AndrewKeepCoding to tie toggle to expander (fixes drag issue losing state) Add some more notes on usage/behavior Co-authored-by: Niels Laute <[email protected]>
Alright, this is ready to go! Thanks @AndrewKeepCoding for the feedback, I think I've addressed it with the binding example (now state is not lost on drag, I think the container is just resetting/hydrating on drop and without the ToggleSwitch bound to anything it was sometimes getting reset). Worked with @niels9001 on the design and alignment. Settings has a custom card example of drag in the Language and Region settings (see the third English card [for when multiple languages]): ![]() However, that'd take a lot more work and customization to do, especially for the expander scenario. For a v1 sample this is a bit simpler and more customizable (drag handle could be on right for instance) and works for both controls. |
Fixes
Adds an example of how to drag/drop settings controls within a list (using drag handle pattern).
Plus Improves Settings Controls examples (minor tweaks)
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Was hard to understand how this interaction behaved with conflicts of mouse interaction with listview drag and WinUI expander/Button.
What is the new behavior?
Nice sample that explains how to make magic happen. 🦙
DraggableSettingsExpander.mp4
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
@niels9001 would love any input on the design here and padding and such.
TODO: